﻿using HuaweiCloud.Dotnet.Samples.Common;
using MongoDB.Bson.Serialization.Attributes;

namespace HuaweiCloud.Dotnet.Samples.ESports.Device.Component
{
    public class Sport : BaseComponent
    {
        public string? DeviceId { get; set; }
        public DateTime StartTime { get; set; }
        public DateTime EndTime { get; set; }
        [BsonIgnore]
        public DateTime Date { get => StartTime.Date; }
        [BsonIgnore]
        public TimeSpan ContinuedSpan { get => (EndTime - StartTime); }
        public string? Description { get; set; }
        public int Distance { get; set; }
        public int HeartRate { get; set; }
    }
}
